<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<TITLE>cgihtml Documentation: Installation</TITLE>
<LINK HREF="cgihtml-4.html" REL=next>
<LINK HREF="cgihtml-2.html" REL=previous>
<LINK HREF="cgihtml.html#toc3" REL=contents>
</HEAD>
<BODY>
<A HREF="cgihtml-4.html">Next</A>
<A HREF="cgihtml-2.html">Previous</A>
<A HREF="cgihtml.html#toc3">Contents</A>
<HR>
<H2><A NAME="s3">3. Installation</A></H2>

<H2><A NAME="ss3.1">3.1 Requirements</A>
</H2>

<P>cgihtml was written for Unix machines in C, although it has been
successfully ported to Windows 95 and NT, VMS, OS-9, and other
operating systems.  All you need is a C compiler, and you should be
set.
<P>By default, cgihtml assumes that the CGI source code goes in the
cgi-src directory and the binaries in the cgi-bin directory.
<P>
<H2><A NAME="ss3.2">3.2 Obtaining and unpacking the distribution</A>
</H2>

<P>You may find cgihtml.tar.gz at
<A HREF="ftp://ftp.eekim.com/users/eekim/cgihtml/">ftp://ftp.eekim.com/users/eekim/cgihtml/</A><P>To unpack the distribution, you must first gunzip it (using the GNU
gzip utility) and then untar it.  Copy the distribution into your CGI
source directory, and try the following command:
<P>
<BLOCKQUOTE><CODE>
<PRE>
% gzip -dc cgihtml.tar.gz | tar xvf -
</PRE>
</CODE></BLOCKQUOTE>
<P>cgihtml is also available in UNIX compressed (.Z) and PKZipped (.zip)
format.
<P>
<H2><A NAME="ss3.3">3.3 Compiling the library</A>
</H2>

<P>To compile the library, examine the Makefiles in the cgihtml and
examples directories, and make sure you are satisfied with the
variables.
<P>
<H3>Makefile variables</H3>

<P>INSTALLDIR in cgihtml's Makefile should point to your CGI source
directory, while INSTALLDIR in your examples directory should point to
your server's CGI binary directory.
<P>
<H3>Compiling for Win32</H3>

<P>If you're compiling for Win32 (ie. Windows 95/NT), make sure to
uncomment the line with -DWINDOWS.
<P>
<H3>Configuring File Uploadn</H3>

<P>By default, the file upload directory is set to /tmp.  To change
this value, uncomment <CODE>#-DUPLOADDIR='"/tmp"'</CODE> in the Makefile and
replace /tmp with the directory of your choice.  Make sure that
whichever directory you choose is surrounded by both the single and
double quotes, ie: <CODE>'"/foo/bar"'</CODE>.
<P>
<H3>Compiling and Installing</H3>

<P>When you are satisfied with the Makefiles, type:
<P>
<BLOCKQUOTE><CODE>
<PRE>
% make cgihtml.a
</PRE>
</CODE></BLOCKQUOTE>
<P>This will produce the file cgihtml.a.  To compile the library as well
as all of the example programs, type:
<P>
<BLOCKQUOTE><CODE>
<PRE>
% make all
</PRE>
</CODE></BLOCKQUOTE>
<P>To install the library and examples, type:
<P>
<BLOCKQUOTE><CODE>
<PRE>
% make install
</PRE>
</CODE></BLOCKQUOTE>
<P>If you want to compile and/or install the example programs separately,
change to the examples subdirectory and use make there.
<P>
<H2><A NAME="ss3.4">3.4 Porting</A>
</H2>

<P>While compiling the libraries on various Unix machines, you may have
trouble with the "ranlib" command.  If you system doesn't seem to have
this command, you most likely don't need.  Set the RANLIB variable in
the Makefile to "true".
<P>If you're compiling for Win32, make sure you use the -DWINDOWS
directive when compiling.
<P>If you are compiling for DOS/16-bit Windows, VMS, or OS-9, you will
need to change the filenames to support your OS.
<P>
<HR>
<A HREF="cgihtml-4.html">Next</A>
<A HREF="cgihtml-2.html">Previous</A>
<A HREF="cgihtml.html#toc3">Contents</A>
</BODY>
</HTML>
